
let timer : ReturnType<typeof setTimeout>
const prompt : IPrompt = {
	$showToast: (title : string, duration = 1500, type ?: IconType) : void => {
		uni.hideToast();
		clearTimeout(timer);
		timer = setTimeout(() => {
			uni.showToast({
				title,
				mask: true,
				icon: type || 'none',
				duration,
			})
		}, 500);
	},
}


const install = () => {
	uni.prompt = prompt;
}


export default {
	install
}